.text
.section .rodata
.LC0:
	.string "result = %d\n"
.LC1:
	.string "input = %d\n"
.LC2:
	.string "a = %d\n"
.LC3:
	.string "b = %d\n"

.text
.globl main
.type main, @function

main:
	leal 4(%esp), %ecx
	andl $-16, %esp
	pushl -4(%ecx)
	pushl %ebp
	movl %esp, %ebp

	pushl %ebx
	pushl %ecx

	subl $16, %esp
	# result
	movl $0, -12(%ebp)
	# input
	movl $1, -16(%ebp)
	# a
	movl $1, -20(%ebp)
	# b
	movl $2, -24(%ebp)

	movl -16(%ebp), %eax
	# 把input赋值给result
	movl %eax, %eax
	movl %eax, -12(%ebp)

	# 调用printf打印result的值
	subl $8, %esp
	pushl -12(%ebp)
	pushl $.LC0
	call printf
	add $16, %esp

	# 调用printf打印input的值
	subl $8, %esp
	pushl -16(%ebp)
	pushl $.LC1
	call printf
	add $16, %esp

	movl -20(%ebp), %eax
	movl -24(%ebp), %ebx

	# 以下是第二部分内嵌汇编
	movl %eax, %ecx
	movl %ebx, %eax
	movl %ecx, %ebx

	movl %eax, -20(%ebp)
	movl %ebx, -24(%ebp)

	# 调用printf打印a
	subl $8, %esp
	pushl -20(%ebp)
	pushl $.LC2
	call printf
	add $16, %esp

	# 调用printf打印b
	subl $8, %esp
	pushl -24(%ebp)
	pushl $.LC3
	call printf
	add $16, %esp

	movl $0, %eax
	leal -8(%ebp), %esp
	popl %ecx
	popl %ebx
	popl %ebp

	leal -4(%ecx), %esp
	ret
